# -*- coding: utf-8 -*-
# function： 轻量级 django 第一个例子
# 引入 wsgi Gunicorn
# 启动 gunicorn helloworldwsgi 即可
# __author__ = 'yeslf'

import  sys
# setting
from django.conf import settings
from django.core.wsgi import get_wsgi_application

settings.configure(
    DEBUG = True,
    SECRET_KEY = 'thisitheseccretkey',
    ROOT_URLCONF = __name__,
    MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    )

)


# MTV-V
from django.http import HttpResponse

def index(request):
    return HttpResponse("hello world")

# MTV-
from django.conf.urls import url

urlpatterns = (
    url(r'^$',index),
)

application = get_wsgi_application()

if __name__ == "__main__":

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)
